#Linux-aarch64-3559A.cmake,指定c/c++编译工具链
# set cross-compiled system type, it's better not use the type which cmake cannot recognized.
SET ( CMAKE_SYSTEM_NAME Linux )
SET ( CMAKE_SYSTEM_PROCESSOR mips )

# when hislicon SDK was installed, toolchain was installed in the path as below:
SET ( CMAKE_C_COMPILER "/opt/ingenic_t23/mips-gcc540-uclibc0.9.33.2-64bit-r3.3.0.smaller/bin/mips-linux-uclibc-gcc" )
SET ( CMAKE_CXX_COMPILER "/opt/ingenic_t23/mips-gcc540-uclibc0.9.33.2-64bit-r3.3.0.smaller/bin/mips-linux-uclibc-g++" )
SET ( CMAKE_FIND_ROOT_PATH "/opt/ingenic_t23/mips-gcc540-uclibc0.9.33.2-64bit-r3.3.0.smaller/bin/" )

# set searching rules for cross-compiler
SET ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
SET ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
SET ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

# set ${CMAKE_C_FLAGS} and ${CMAKE_CXX_FLAGS}flag for cross-compiled process
SET ( CMAKE_CXX_FLAGS "-march=mips32r2 ${CMAKE_CXX_FLAGS}" )

# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -s -ffunction-sections -fdata-sections -Wl,-Bsymbolic -muclibc -lm -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -lpthread" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -s -ffunction-sections -fdata-sections -Wl,-Bsymbolic -muclibc -lm -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -lpthread" CACHE STRING "c++ flags")

